name: CI

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

env:
  OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ ubuntu-latest ]
        python-version: [ 3.8, 3.9 ]
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install Manifest
        run: |
          make dev
      - name: Run preliminary checks
        run: |
          make check
      - name: Test with pytest
        run: |
          OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}  make test
